package com.hhs.storage.controller;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.hhs.storage.bean.InputParam;
import com.hhs.storage.bean.JxcProduct;
import com.hhs.storage.bean.JxcRole;
import com.hhs.storage.bean.User;
import com.hhs.storage.service.JxcProductService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author shadow
 * @since 2018-12-18
 */
@RestController
@RequestMapping("/do/product")
@Slf4j
public class JxcProductController {
    @Resource
    JxcProductService jxcProductService;


    @GetMapping(value = "getAll")
    public Map<String, Object> getAll(InputParam inputParam) {
        log.info("查询库存分页信息");
        Page<JxcProduct> result = jxcProductService.findPage(inputParam);
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("rows", result.getRecords());
        map.put("total",result.getTotal());
        return map;

    }

}

